/ Assembly List / LJCDBClientLib / ObjectManager`2 / Update

Namespace - LJCDBClientLib


Parameters
dataObject - The record object.
keyColumns - The record containing the key field values.
propertyNames - The incuded column property names.
filters - The filter values.

Syntax

C#
public Void Update(TData dataObject, DbColumns keyColumns, List<String> propertyNames = null, DbFilters filters = null)

Updates the record. (E)

Example

C#
// Updates a record.
private static void Update(ObjectManager<Person, Persons> personManager)
{
  // Create the list of included columns.
  // This list must not include the DB assigned columns
  // or the database assigned columns must have the AutoIncrement
  // value set to "true".
  List<string> columnNames = new List<string>() { "Name" };

  Person dataObject = new Person()
  {
    Name = "TestNameUpdated"
  };

  // Create Key Columns.
  var keyColumns = new DbColumns()
  {
    Name = "TestName"
  };

  // Update the record.
  personManager.Update(dataObject, keyColumns, columnNames);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.